package orders

// 表名也是cache的tag
var TableName = "orders"

// 订单
type Orders struct {
	Id         int64
	UserId     string `xorm:"varchar(64) notnull index 'users_id'"`
	OrderId    string `xorm:"varchar(64) notnull unique 'order_id'"`
	GoodsId    int64  `xorm:"integer(11) notnull index  'goods_id'"`
	MerchantId int64  `xorm:"integer(11) notnull index  'merchant_id'"`

	Quantity   int64 `xorm:"integer(11) notnull 'quantity'"`
	UnitPrice  int64 `xorm:"BIGINT notnull 'unit_price'"`
	TotalPrice int64 `xorm:"BIGINT notnull 'total_price'"`

	AddTime        int64 `xorm:"integer notnull 'add_time'"`
	PayTime        int64 `xorm:"integer null 'pay_time'"`
	UserCancelTime int64 `xorm:"integer null 'user_cancel_time'"`
	UserReturnTime int64 `xorm:"integer null 'user_return_time'"`

	Status          int `xorm:"tinyint(4) notnull default(1) 'status'"`
	ReturnStatus    int `xorm:"tinyint(4) notnull default(1) 'return_status'"`
	LogisticsStatus int `xorm:"tinyint(4) notnull default(1) 'logistics_status'"`
}
